<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    x轴:<span class="x">0</span>
    y轴:<span class="y">0</span>
    <script>
        // 需求 
        // 鼠标移动 实时获取坐标点  

        // 移动  mousemove  
        // 相对于可视化窗口的左上角  clientX  clientY  


        // 拿到坐标以后 放到指定的位置 


        //获取元素 
        var x = document.querySelector('.x');
        var y = document.querySelector('.y');


        // 鼠标在整个文档内活动  
        document.onmousemove = function(e){
            e = e || window.event;

            var data1 = e.clientX;
            var data2 = e.clientY;

            x.innerText = data1;
            y.innerText = data2;
        }
    </script>    
</body>
</html>